/*
https://leetcode-cn.com/problems/add-digits/solution/ge-wei-xiang-jia-by-leetcode-solution-u4kj/
 */
public class Solution258 {
    public int addDigits(int num) {
        return (num-1)%9+1;
    }

    public static void main(String[] args) {
        System.out.println(new Solution258().addDigits(38));
    }
}
